<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/WEB-INF/jspf/meta/meta.jspf"%>
<title>科目管理</title>
<%@include file="/WEB-INF/jspf/adminPage.jspf"%>
<%@include file="/WEB-INF/jspf/css_js/easyui_grid_tools_js.jspf"%>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/static/subject/subjectAdd2.js"></script>
</head>

<script type="text/javascript">
$(function(){
	//启动即初始化一些行
	var index;
	for(var i=1;i<=2;i++){
		index=subjectObject.addRow({subjectName : '科目默认值'+i,subjectInfo:'备注默认值'+i});
	}
});
function updateRow(a,b){
	console.log(a);
}
</script>
<body>
	<table id="dg_subject" class="easyui-datagrid"
		data-options="
		fit:true
		,fitColumns:false
		,singleSelect:true
		,toolbar:'#tb_subject'
		,onClickCell:onClickCell
        ,onEndEdit: onEndEdit
		">
		<thead>
			<tr>
				<th data-options="field:'subjectName',width:200,align:'center',editor:'text'">科目名</th>
				<th data-options="field:'subjectInfo',width:200,align:'center',editor:'text'">科目备注</th>
				<th data-options="field:'classroomId',width:200,hidden:true">教室主键 我是隐藏的。你看不见我</th>
				<th data-options="field:'classroomName',width:200,align:'center',
						editor:{
							type:'combobox',
							options:{
								valueField:'classroomId',
								textField:'classroomName',
								width:200,
								method:'post',
								url:'<%=request.getContextPath()%>/classroom/selectAllClassroomByName.json'
							}
						}">教室名</th>
			</tr>
		</thead>
	</table>
	
	<!-- 工具栏使用 -->
	<div id="tb_subject" style="padding: 5px; height: auto">
		<div>
			<a href="javascript:void(0)" class="easyui-linkbutton" plain="true"
				onclick="dellRow()">移除行</a> <a href="javascript:void(0)"
				class="easyui-linkbutton" plain="true" onclick="addRow()">添加行</a> <a
				href="javascript:void(0)" class="easyui-linkbutton" plain="true"
				onclick="MoveUp()">上移</a> <a href="javascript:void(0)"
				class="easyui-linkbutton" plain="true" onclick="MoveDown()">下移</a> <a
				href="javascript:void(0)" class="easyui-linkbutton"
				iconCls="icon-save" plain="true" onclick="submitForm()">保存</a>
		</div>
		<br>
		<div>
			<form id="form_subject" method="post">
			<input type="hidden" id="bodyData" name="bodyData" />
				<table cellpadding="5">
					<tr>
						<td>表头数据1:</td>
						<td><input class="easyui-textbox" type="text" name="head1"
							data-options="required:true"></input></td>
						<td>表头数据2:</td>
						<td><input class="easyui-textbox" type="text" name="head2"
							data-options="required:true"></input></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</body>
</html>